package de.g18.llmaa.gui.workspace.internalFrame.dbAbgleich;

import java.awt.BorderLayout;
import java.beans.PropertyVetoException;

import javax.swing.JPanel;

import de.g18.llmaa.gui.workspace.internalFrame.Abstract_InternalFrame;

public class InternalFrame_DB_Abgleich extends Abstract_InternalFrame {
	
	private JPanel panelCenter = new JPanel_DB_Abgleich_Step_1(this);
	
	private int correntStep = 0;
	
	public InternalFrame_DB_Abgleich()
	{

		initGUI();
	}

	private void initGUI() {
		setSize(400,400);
		setTitle("DB Abgleich");
		setLayout(new BorderLayout());
		add(panelCenter,BorderLayout.CENTER);
		
	}

	void closeFrame() {
		try {
			setClosed(true);
		} catch (PropertyVetoException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void nextStep() {
		correntStep ++;
		switch (correntStep) {
		case 1:
			System.out.println("das");
			this.remove(panelCenter);
			panelCenter = new JPanel_DB_Abgleich_Step_2(((JPanel_DB_Abgleich_Step_1)panelCenter).getListProducts());
			add(panelCenter,BorderLayout.CENTER);
			panelCenter.updateUI();
			updateUI();
			
			break;

		default:
			break;
		}
		// TODO Auto-generated method stub
		
	}

}
